from django import template
from django.contrib.sites.models import Site

register = template.Library()

@register.inclusion_tag('navigation_primary.html', takes_context=True)
def navigation_primary(context, active = '', link = True):
    return {
        'active': active,
        'link': link,
        'request': context['request'],
        'settings': context['settings'],
    }

@register.inclusion_tag('footer.html', takes_context=True)
def footer(context):
    return {
        'request': context['request'],
        'settings': context['settings'],
    }

@register.simple_tag
def current_domain():
    return Site.objects.get_current()